MonitorTableFixView = function(element){
	this.table = element;
	this.view = [];
	this.loadView();
}

MonitorTableFixView.prototype = {
		
	/* 视图装载 */	
	loadView:function(){
		for(var i=0;i<this.table.table.length;i++){
			var tview = new MonitorTableView(this.table.table[i]);
			tview.setTableId(tview.table.tid);
			this.view.push(tview);
		}	
	},

	/* 移除页面所有表格DIV */
	remove:function(){
		$(".xs").remove();
	},
	
	/* 刷新页面数据 */
	refresh:function(){
	   this.remove();
	   this.load();
	},
	
	/* 装载页面数据 */
	load:function(){
	   this.remove();
	   
	   //装载视图
	   for(var i=0;i<this.view.length;i++){
		   this.loadTableDiv(this.view[i]);
		   this.loadTable(this.view[i]);
	   }
	   
	},
	
	/* 装载表格DIV */
	loadTableDiv:function(view){
		view.loadDiv();
	},
	
	/* 装载表格数据 */
	loadTable:function(view){
		view.load();
	},
	
	/* 设置布局 */
	setLayOut:function(layout){
		this.layout = layout;
	},
	
	/* 设置标题颜色 */
	setPanelColor:function(panelColor){
		this.panelColor = panelColor;
		 for(var i=0;i<this.view.length;i++){
			 this.view[i].setPanelColor(this.panelColor);
		 }
	},
	
	/* 设置填充DIV标示 */
	setDivId:function(divId){
		this.divId = divId;
		 for(var i=0;i<this.view.length;i++){
			 this.view[i].setDivId(this.divId);
		 }
	},
	
	/* 设置是否清除表间距 */
	setIsPadding:function(isPadding){
		this.isPadding = isPadding;
		 for(var i=0;i<this.view.length;i++){
			 this.view[i].setIsPadding(this.isPadding);
		 }
	},
	
	/* 装载后执行 */
	loadAfter:function(){
		
		//布局处理
		if(this.layout != undefined){
			var laynum = this.layout.length;
			var tablenum = this.view.length;
			for(var i=0;i<tablenum;i++){
				var j = i % laynum;
				$(".xs").eq(i).attr("class","xs col-md-"+this.layout[j]);
			}
			
		}
		
	},
	
	/* 设置按钮 */
	setButtons:function(buttons){
		this.buttons = buttons;
		for(var i=0;i<this.view.length;i++){
			 this.view[i].setButtons(this.buttons);
		}
	}
	
}